package com.twu.biblioteca.controller;

import com.twu.biblioteca.io.InputReader;
import com.twu.biblioteca.model.Item;
import com.twu.biblioteca.model.Library;
import com.twu.biblioteca.ui.BookView;
import com.twu.biblioteca.util.Messages;

import java.util.List;

/**
 * Created by madhu on 27/4/14.
 */
public class BookController extends ItemController {

    private BookView bookView;

    public BookController() {
        bookView = new BookView();
    }

    public void checkoutBook(String bookName, List<Item> books) {
        if(checkoutItem(bookName, books))
            bookView.displayMessage(Messages.successfulBookCheckoutMessage);
        else
            bookView.displayMessage(Messages.unsuccessfulBookCheckoutMessage);
    }

    public void returnBook(String bookName, List<Item> books) {
        if(returnItem(bookName, books))
            bookView.displayMessage(Messages.successfulBookReturnMessage);
        else
            bookView.displayMessage(Messages.unsuccessfulBookReturnMessage);
    }

}
